home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / CMScriptingPlugin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  4.9 KB  |  123 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMScriptingPlugin.h
  3.  
  4.      Contains:    ColorSync Scripting Plugin API
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMSCRIPTINGPLUGIN__
  18. #define __CMSCRIPTINGPLUGIN__
  19.  
  20. #ifndef __FILES__
  21. #include <Files.h>
  22. #endif
  23. #ifndef __CMAPPLICATION__
  24. #include <CMApplication.h>
  25. #endif
  26. #ifndef __CODEFRAGMENTS__
  27. #include <CodeFragments.h>
  28. #endif
  29.  
  30.  
  31.  
  32.  
  33.  
  34. #if PRAGMA_ONCE
  35. #pragma once
  36. #endif
  37.  
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41.  
  42. #if PRAGMA_IMPORT
  43. #pragma import on
  44. #endif
  45.  
  46. #if PRAGMA_STRUCT_ALIGN
  47.     #pragma options align=mac68k
  48. #elif PRAGMA_STRUCT_PACKPUSH
  49.     #pragma pack(push, 2)
  50. #elif PRAGMA_STRUCT_PACK
  51.     #pragma pack(2)
  52. #endif
  53.  
  54.  
  55. enum {
  56.                                                                 /* ColorSync Scripting AppleEvent Errors */
  57.     cmspInvalidImageFile        = -4220,                        /* Plugin cannot handle this image file type */
  58.     cmspInvalidImageSpace        = -4221,                        /* Plugin cannot create an image file of this colorspace */
  59.     cmspInvalidProfileEmbed        = -4222,                        /* Specific invalid profile errors */
  60.     cmspInvalidProfileSource    = -4223,
  61.     cmspInvalidProfileDest        = -4224,
  62.     cmspInvalidProfileProof        = -4225,
  63.     cmspInvalidProfileLink        = -4226
  64. };
  65.  
  66.  
  67. /**** embedFlags field  ****/
  68. /* reserved for future use: currently 0 */
  69.  
  70. /**** matchFlags field  ****/
  71.  
  72. enum {
  73.     cmspFavorEmbeddedMask        = 0x00000001                    /* if bit 0 is 0 then use srcProf profile, if 1 then use profile embedded in image if present*/
  74. };
  75.  
  76.  
  77. typedef CALLBACK_API_C( CMError , ValidateImageProcPtr )(const FSSpec *spec);
  78. typedef CALLBACK_API_C( CMError , GetImageSpaceProcPtr )(const FSSpec *spec, OSType *space);
  79. typedef CALLBACK_API_C( CMError , ValidateSpaceProcPtr )(const FSSpec *spec, OSType *space);
  80. typedef CALLBACK_API_C( CMError , EmbedImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, CMProfileRef embedProf, UInt32 embedFlags);
  81. typedef CALLBACK_API_C( CMError , MatchImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, UInt32 qual, UInt32 srcIntent, CMProfileRef srcProf, CMProfileRef dstProf, CMProfileRef prfProf, UInt32 matchFlags);
  82. typedef STACK_UPP_TYPE(ValidateImageProcPtr)                     ValidateImageUPP;
  83. typedef STACK_UPP_TYPE(GetImageSpaceProcPtr)                     GetImageSpaceUPP;
  84. typedef STACK_UPP_TYPE(ValidateSpaceProcPtr)                     ValidateSpaceUPP;
  85. typedef STACK_UPP_TYPE(EmbedImageProcPtr)                         EmbedImageUPP;
  86. typedef STACK_UPP_TYPE(MatchImageProcPtr)                         MatchImageUPP;
  87. enum { uppValidateImageProcInfo = 0x000000F1 };                 /* 4_bytes Func(4_bytes) */
  88. enum { uppGetImageSpaceProcInfo = 0x000003F1 };                 /* 4_bytes Func(4_bytes, 4_bytes) */
  89. enum { uppValidateSpaceProcInfo = 0x000003F1 };                 /* 4_bytes Func(4_bytes, 4_bytes) */
  90. enum { uppEmbedImageProcInfo = 0x00003FF1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  91. enum { uppMatchImageProcInfo = 0x003FFFF1 };                     /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  92. #define NewValidateImageProc(userRoutine)                         (ValidateImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppValidateImageProcInfo, GetCurrentArchitecture())
  93. #define NewGetImageSpaceProc(userRoutine)                         (GetImageSpaceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetImageSpaceProcInfo, GetCurrentArchitecture())
  94. #define NewValidateSpaceProc(userRoutine)                         (ValidateSpaceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppValidateSpaceProcInfo, GetCurrentArchitecture())
  95. #define NewEmbedImageProc(userRoutine)                             (EmbedImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppEmbedImageProcInfo, GetCurrentArchitecture())
  96. #define NewMatchImageProc(userRoutine)                             (MatchImageUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMatchImageProcInfo, GetCurrentArchitecture())
  97. #define CallValidateImageProc(userRoutine, spec)                 CALL_ONE_PARAMETER_UPP((userRoutine), uppValidateImageProcInfo, (spec))
  98. #define CallGetImageSpaceProc(userRoutine, spec, space)         CALL_TWO_PARAMETER_UPP((userRoutine), uppGetImageSpaceProcInfo, (spec), (space))
  99. #define CallValidateSpaceProc(userRoutine, spec, space)         CALL_TWO_PARAMETER_UPP((userRoutine), uppValidateSpaceProcInfo, (spec), (space))
  100. #define CallEmbedImageProc(userRoutine, specFrom, specInto, embedProf, embedFlags)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppEmbedImageProcInfo, (specFrom), (specInto), (embedProf), (embedFlags))
  101. #define CallMatchImageProc(userRoutine, specFrom, specInto, qual, srcIntent, srcProf, dstProf, prfProf, matchFlags)  CALL_EIGHT_PARAMETER_UPP((userRoutine), uppMatchImageProcInfo, (specFrom), (specInto), (qual), (srcIntent), (srcProf), (dstProf), (prfProf), (matchFlags))
  102.  
  103. #if PRAGMA_STRUCT_ALIGN
  104.     #pragma options align=reset
  105. #elif PRAGMA_STRUCT_PACKPUSH
  106.     #pragma pack(pop)
  107. #elif PRAGMA_STRUCT_PACK
  108.     #pragma pack()
  109. #endif
  110.  
  111. #ifdef PRAGMA_IMPORT_OFF
  112. #pragma import off
  113. #elif PRAGMA_IMPORT
  114. #pragma import reset
  115. #endif
  116.  
  117. #ifdef __cplusplus
  118. }
  119. #endif
  120.  
  121. #endif /* __CMSCRIPTINGPLUGIN__ */
  122.  
  123.